/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gob.pnp.actions;

import com.opensymphony.xwork2.*;
import java.sql.SQLException;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;
import pe.gob.pnp.despachadores.*;

/**
 *
 * @author  Gregorovichz Carlos Rossi
 * @date    01/04/2010
 *
 */
public class ListaModulosDisponibles extends ActionSupport implements ServletRequestAware{
    private List<Modulo> lstModulos;
    private HttpServletRequest servletRequest;

    @Override
    public String execute(){
        try{
            setLstModulos(ModuloDespachador.obtenerModulos());
        }catch(SQLException ex){
            ex.printStackTrace();
            return ERROR;
        }
        return SUCCESS;
    }

    public void setServletRequest(HttpServletRequest servletRequest) {
        this.servletRequest = servletRequest;
    }

    /**
     * @return the lstModulos
     */
    public List<Modulo> getLstModulos() {
        return lstModulos;
    }

    /**
     * @param lstModulos the lstModulos to set
     */
    public void setLstModulos(List<Modulo> lstModulos) {
        this.lstModulos = lstModulos;
    }

    /**
     * @return the servletRequest
     */
    public HttpServletRequest getServletRequest() {
        return servletRequest;
    }
}
